package com.py.pythink.service.impl;

import com.py.pythink.bo.AssessBo;
import com.py.pythink.dao.AssessDao;
import com.py.pythink.service.intf.AssessService;
import com.py.pythink.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AssessServiceImpl implements AssessService {
    @Autowired
    private AssessDao dao;
    @Override
    public R queryMoney(String address, String type,Integer num) {
        if(address.length()>0 && type.length()>0){
            if(dao.selectByAddress(address,type)!=null){
                AssessBo bo = dao.selectByAddress(address, type);
                double v = bo.getPrice() * num;
                return R.ok(v);
            }
        }
        return R.fail("请正确输入");
    }

    @Override
    public R query() {
        return null;
    }
}
